const init  ={
    count:0
}

export default function countReducer(prevState=init,action){
    // console.log('reducer调用了');

    const {type,data} =action

    switch(type){
        case 'incrementCount':
            return{...init,count:prevState.count+data}
        case 'decrementCount':
            return {...init, count:prevState.count-data}
    }
    return prevState
}